package com.example.windowdemo.window.proxy;

import android.content.Context;
import android.view.KeyEvent;
import android.view.View;

import com.example.windowdemo.window.Window;

/**
 * @author: njb
 * @date: 2023/8/2 17:49
 * @desc:
 */
public class WindowProxy<T> extends Window<T> {
    private Window<T> window;

    public WindowProxy(Context context) {
        super(context);
        this.window = new Window<>(context);
    }

    @Override
    public void setFullScreen(boolean isFullScreen) {
        window.setFullScreen(isFullScreen);
    }

    @Override
    public void setTitleBar(boolean hasTitleBar) {
        window.setTitleBar(hasTitleBar);
    }

    @Override
    public void setSize(int width, int height) {
        window.setSize(width, height);
    }

    @Override
    public void setPosition(int x, int y) {
        window.setPosition(x, y);
    }

    @Override
    public void setGravity(int gravity) {
        window.setGravity(gravity);
    }

    @Override
    public void setData(T data) {
        window.setData(data);
    }

    @Override
    public void addView(View view) {
        window.addView(view);
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        return window.dispatchKeyEvent(keyEvent);
    }

    @Override
    public void show() {
        window.show();
    }

    @Override
    public void hide() {
        window.hide();
    }

    @Override
    public void onDetachedFromWindow() {
        window.onDetachedFromWindow();
    }
}
